package ru.usu.gv.gui.actions;

import ru.usu.gv.core.GraphCanvas;
import ru.usu.gv.uicomponents.UIGraph;
import ru.usu.gv.uicomponents.UIVertex;

/**
 * @author spupyrev
 * 02.11.2008
 */
public class ShowVertexLabelsAction extends ActionBase
{
	private boolean showLabels;

	public ShowVertexLabelsAction(boolean showLabels)
	{
		this.showLabels = showLabels;
	}

	@Override
	public void execute()
	{
		UIGraph currentGraph = GraphCanvas.getInstance().getCurrentGraph();
		for (UIVertex v : currentGraph.getVertexes())
		{
			if (showLabels)
				v.showLabel();
			else
				v.hideLabel();
		}
	}

}
